package com.up.upzl.biz.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import com.up.upzl.base.service.impl.BaseServiceImpl;
import com.up.upzl.biz.domain.ShopTag;
import com.up.upzl.biz.repository.ShopTagRepository;
import com.up.upzl.biz.service.ShopTagService;

@Service
public class ShopTagServiceImpl extends BaseServiceImpl<ShopTag, Long> implements ShopTagService {

	@Autowired
	private ShopTagRepository shopTagRepository;

	@Override
	public Page<ShopTag> findByNameLike(String name, Pageable page) {
		return shopTagRepository.findByNameLike("%" + name + "%", page);
	}

	@Override
	public Integer countShopByShopTag(Long shopTagId) {
		return shopTagRepository.countShopByShopTag(shopTagId);
	}

	@Override
	public ShopTag findByName(String name) {
		return shopTagRepository.findByName(name);
	}

}
